2003-08-31 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkactiongroup.c: Add some docs.
+ * gtk/gtkaction.c:
+ * gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
- wasn't emitted anyway.
+ wasn't emitted anyway. Some doc tweaks.
2003-08-30 Matthias Clasen <maclas@gmx.de>
2003-08-31 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkactiongroup.c: Add some docs.
+ * gtk/gtkaction.c:
+ * gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
- wasn't emitted anyway.
+ wasn't emitted anyway. Some doc tweaks.
2003-08-30 Matthias Clasen <maclas@gmx.de>
2003-08-31 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkactiongroup.c: Add some docs.
+ * gtk/gtkaction.c:
+ * gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
- wasn't emitted anyway.
+ wasn't emitted anyway. Some doc tweaks.
2003-08-30 Matthias Clasen <maclas@gmx.de>
2003-08-31 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkactiongroup.c: Add some docs.
+ * gtk/gtkaction.c:
+ * gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
- wasn't emitted anyway.
+ wasn't emitted anyway. Some doc tweaks.
2003-08-30 Matthias Clasen <maclas@gmx.de>
2003-08-31 Matthias Clasen <maclas@gmx.de>
- * gtk/gtkactiongroup.c: Add some docs.
+ * gtk/gtkaction.c:
+ * gtk/gtkactiongroup.c: Some doc tweaks.
* gtk/gtkuimanager.[hc]: Get rid of the remove_widget signal. It
- wasn't emitted anyway.
+ wasn't emitted anyway. Some doc tweaks.
2003-08-30 Matthias Clasen <maclas@gmx.de>
+2003-08-31 Matthias Clasen <maclas@gmx.de>
+
+ * gtk/tmpl/gtkuimanager.sgml:
+ * gtk/tmpl/gtkactiongroup.sgml:
+ * gtk/tmpl/gtkaction.sgml:
+ * gtk/tmpl/gtktoggleaction.sgml:
+ * gtk/tmpl/gtkradioaction.sgml: Additions.
+
+ * gtk/gtk-sections.txt: Updates.
+
+ * gtk/gtk.types: Add GtkAction, GtkActionGroup, GtkToggleAction,
+ GtkRadioAction and GtkUIManager.
+
2003-08-28 Matthias Clasen <maclas@gmx.de>
* gdk/tmpl/events.sgml: Improve PointerHint docs.
<FILE>gtkactiongroup</FILE>
<TITLE>GtkActionGroup</TITLE>
GtkActionGroup
-GtkActionGroupEntryTrype
-GtkActionGroupEntry
+GtkActionEntry
+GtkRadioActionEntry
gtk_action_group_new
gtk_action_group_get_name
gtk_action_group_get_action
gtk_action_group_add_action
gtk_action_group_remove_action
gtk_action_group_add_actions
+gtk_action_group_add_actions_full
+gtk_action_group_add_radio_actions
+gtk_action_group_add_radio_actions_full
+gtk_action_group_set_translate_func
+gtk_action_group_set_translation_domain
<SUBSECTION Standard>
GTK_TYPE_ACTION_GROUP
GTK_ACTION_GROUP
<TITLE>GtkUIManager</TITLE>
GtkUIManager
gtk_ui_manager_new
+gtk_ui_manager_set_add_tearoffs
+gtk_ui_manager_get_add_tearoffs
gtk_ui_manager_insert_action_group
gtk_ui_manager_remove_action_group
gtk_ui_manager_get_action_groups
gtk_ui_manager_add_ui_from_file
gtk_ui_manager_remove_ui
gtk_ui_manager_get_ui
+gtk_ui_manager_activate
<SUBSECTION Standard>
GTK_TYPE_UI_MANAGER
GTK_UI_MANAGER
GtkRadioAction
gtk_radio_action_get_group
gtk_radio_action_set_group
+gtk_radio_action_get_current_value
<SUBSECTION Standard>
GTK_TYPE_RADIO_ACTION
GTK_RADIO_ACTION
GTK_RADIO_ACTION_GET_CLASS
<SUBSECTION Private>
gtk_radio_action_get_type
-GtkRadionActionPrivate
+GtkRadioActionPrivate
</SECTION>
<SECTION>
gtk_accel_group_get_type
gtk_accel_label_get_type
gtk_accessible_get_type
+gtk_action_get_type
+gtk_action_group_get_type
gtk_adjustment_get_type
gtk_alignment_get_type
gtk_arrow_get_type
gtk_preview_get_type
gtk_progress_bar_get_type
gtk_progress_get_type
+gtk_radio_action_get_type
gtk_radio_button_get_type
gtk_radio_menu_item_get_type
gtk_radio_tool_button_get_type
gtk_text_tag_table_get_type
gtk_text_view_get_type
gtk_tips_query_get_type
+gtk_toggle_action_get_type
gtk_toggle_button_get_type
gtk_toggle_tool_button_get_type
gtk_toolbar_get_type
gtk_tree_store_get_type
gtk_tree_view_column_get_type
gtk_tree_view_get_type
+gtk_ui_manager_get_type
gtk_vbox_get_type
gtk_vbutton_box_get_type
gtk_viewport_get_type
GtkAction
<!-- ##### SECTION Short_Description ##### -->
-
+an action which can be triggered by a menu or toolbar item
<!-- ##### SECTION Long_Description ##### -->
<para>
-
+Actions represent operations that the user can be perform, along with
+some information how it should be presented in the interface. Each action
+provides methods to create icons, menu items and toolbar items representing
+itself.
+</para>
+<para>
+As well as the callback that is called when the action gets activated, the
+following also gets associated with the action:
+<itemizedlist>
+ <listitem><para>a name (not translated, for path lookup)</para></listitem>
+ <listitem><para>a label (translated, for display)</para></listitem>
+ <listitem><para>an accelerator</para></listitem>
+ <listitem><para>whether label indicates a stock id</para></listitem>
+ <listitem><para>a tooltip (optional, translated)</para></listitem>
+ <listitem><para>a toolbar label (optional, shorter than label)</para></listitem>
+</itemizedlist>
+The action will also have some state information:
+<itemizedlist>
+ <listitem><para>visible (shown/hidden)</para></listitem>
+ <listitem><para>sensitive (enabled/disabled)</para></listitem>
+</itemizedlist>
+</para>
+<para>
+Apart from regular actions, there are <link linkend="GtkToggleAction">toggle
+actions</link>, which can be toggled between two states and <link
+linkend="GtkRadioAction">radio actions</link>, of which only one in a group
+can be in the "active" state. Other actions can be implemented as #GtkAction
+subclasses.
+</para>
+<para>
+Each action can have one or more proxy menu item, toolbar button or
+other proxy widgets. Proxies mirror the state of the action (text
+label, tooltip, icon, visible, sensitive, etc), and should change when
+the action's state changes. When the proxy is activated, it should
+activate its action.
</para>
-
<!-- ##### SECTION See_Also ##### -->
<para>
-
+#GtkActionGroup, #GtkMenuMerge
</para>
-
<!-- ##### STRUCT GtkAction ##### -->
<para>
-
+The <structname>GtkAction</structname> struct contains only private members
+and should not be accessed directly.
</para>
-@object:
<!-- ##### FUNCTION gtk_action_get_name ##### -->
<para>
@accel_path:
+<!-- ##### SIGNAL GtkAction::activate ##### -->
+<para>
+
+</para>
+
+@action: the object which received the signal.
+
+<!-- ##### ARG GtkAction:label ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:name ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:sensitive ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:short-label ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:stock-id ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:tooltip ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:visible ##### -->
+<para>
+
+</para>
+
GtkActionGroup
<!-- ##### SECTION Short_Description ##### -->
-
+a group of actions
<!-- ##### SECTION Long_Description ##### -->
<para>
-
+Actions are organised into groups. An action group is essentially a
+map from names to #GtkAction objects.
+</para>
+<para>
+All actions that would make sense to use in a particular context
+should be in a single group. Multiple action groups may be used for a
+particular user interface. In fact, it is expected that most nontrivial
+applications will make use of multiple groups. For example, in an application
+that can edit multiple documents, one group holding global actions
+(eg. quit, about, new), and one group per document holding actions that
+act on that document (eg. save, cut/copy/paste, etc). Each window's menus
+would be constructed from a combination of two action groups.
</para>
-
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
-
<!-- ##### STRUCT GtkActionGroup ##### -->
<para>
-
+The <structname>GtkActionGroup</structname> struct contains only private members
+and should not be accessed directly.
</para>
-@parent:
-<!-- ##### STRUCT GtkActionGroupEntry ##### -->
+<!-- ##### STRUCT GtkActionEntry ##### -->
<para>
+<structname>GtkActionEntry</structname> structs are used with
+gtk_action_group_add_actions() to construct actions.
+</para>
+@name: The name of the action.
+@stock_id: The stock id for the action.
+@label: The label for the action. This field should typically be marked for
+ translation, see gtk_action_group_set_translation_domain().
+@accelerator: The accelerator for the action, in the format understood by
+ gtk_accelerator_parse().
+@tooltip: The tooltip for the action. This field should typically be marked for
+ translation, see gtk_action_group_set_translation_domain().
+@callback: The function to call when the action is activated.
+@is_toggle: If this is %TRUE, a #GtkToggleAction is constructed, else a #GtkAction.
+
+<!-- ##### STRUCT GtkRadioActionEntry ##### -->
+<para>
+<structname>GtkRadioActionEntry</structname> structs are used with
+gtk_action_group_add_radio_actions() to construct radio actions.
</para>
-@name:
-@label:
-@stock_id:
-@accelerator:
-@tooltip:
-@callback:
-@user_data:
-@entry_type:
-@extra_data:
+@name: The name of the action.
+@stock_id: The stock id for the action.
+@label: The label for the action. This field should typically be marked for
+ translation, see gtk_action_group_set_translation_domain().
+@accelerator: The accelerator for the action, in the format understood by
+ gtk_accelerator_parse().
+@tooltip: The tooltip for the action. This field should typically be marked for
+ translation, see gtk_action_group_set_translation_domain().
+@value: The value to set on the radio action. See gtk_radio_action_get_current_value().
<!-- ##### FUNCTION gtk_action_group_new ##### -->
<para>
@action_group:
@entries:
@n_entries:
+@user_data:
+
+
+<!-- ##### FUNCTION gtk_action_group_add_actions_full ##### -->
+<para>
+
+</para>
+
+@action_group:
+@entries:
+@n_entries:
+@user_data:
+@destroy:
+
+
+<!-- ##### FUNCTION gtk_action_group_add_radio_actions ##### -->
+<para>
+
+</para>
+
+@action_group:
+@entries:
+@n_entries:
+@on_change:
+@user_data:
+
+
+<!-- ##### FUNCTION gtk_action_group_add_radio_actions_full ##### -->
+<para>
+
+</para>
+
+@action_group:
+@entries:
+@n_entries:
+@on_change:
+@user_data:
+@destroy:
+
+
+<!-- ##### FUNCTION gtk_action_group_set_translate_func ##### -->
+<para>
+
+</para>
+
+@action_group:
+@func:
+@data:
+@notify:
+
+
+<!-- ##### FUNCTION gtk_action_group_set_translation_domain ##### -->
+<para>
+
+</para>
+
+@action_group:
+@domain:
GtkRadioAction
<!-- ##### SECTION Short_Description ##### -->
-
+an action of which only one in a group can be active
<!-- ##### SECTION Long_Description ##### -->
<para>
-
-</para>
-
+A #GtkRadioAction is similar to #GtkRadioMenuItem. A number of radio
+actions can be linked together so that only one may be active at any
+one time.
+</para>
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
-
<!-- ##### STRUCT GtkRadioAction ##### -->
<para>
-
+The <structname>GtkRadioAction</structname> struct contains
+only private members and should not be accessed directly.
</para>
-@parent:
<!-- ##### FUNCTION gtk_radio_action_get_group ##### -->
<para>
@group:
+<!-- ##### FUNCTION gtk_radio_action_get_current_value ##### -->
+<para>
+
+</para>
+
+@action:
+@Returns:
+
+
+<!-- ##### SIGNAL GtkRadioAction::changed ##### -->
+<para>
+
+</para>
+
+@radioaction: the object which received the signal.
+@arg1:
+
+<!-- ##### ARG GtkRadioAction:value ##### -->
+<para>
+
+</para>
+
GtkToggleAction
<!-- ##### SECTION Short_Description ##### -->
-
+an action which can be toggled between two states
<!-- ##### SECTION Long_Description ##### -->
<para>
-
+A #GtkToggleAction corresponds roughly to a #GtkCheckMenuItem. It has an
+"active" state specifying whether the action has been checked or not.
</para>
-
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
-
<!-- ##### STRUCT GtkToggleAction ##### -->
<para>
-
+The <structname>GtkToggleAction</structname> struct contains only
+private members and should not be accessed directly.
</para>
-@parent:
<!-- ##### FUNCTION gtk_toggle_action_toggled ##### -->
<para>
@Returns:
+<!-- ##### SIGNAL GtkToggleAction::toggled ##### -->
+<para>
+
+</para>
+
+@toggleaction: the object which received the signal.
+
one or more UI definitions, which reference actions from one or ore
action groups.
</para>
-
+<refsect2 id="XML-UI"><title>UI Definitions</title>
+<para>
+The UI definitions are specified in an XML format which is described
+by the following DTD.
+<programlisting>
+<!ELEMENT ui (menubar|toolbar|popup)* >
+<!ELEMENT menubar (menuitem|separator|placeholder|menu)* >
+<!ELEMENT menu (menuitem|separator|placeholder|menu)* >
+<!ELEMENT popup (menuitem|separator|placeholder|menu)* >
+<!ELEMENT toolbar (toolitem|separator|placeholder)* >
+<!ELEMENT placeholder (menuitem|toolitem|separator|placeholder|menu)* >
+<!ELEMENT menuitem EMPTY >
+<!ELEMENT toolitem EMPTY >
+<!ELEMENT separator EMPTY >
+<!ATTLIST menubar name #IMPLIED >
+<!ATTLIST toolbar name #IMPLIED >
+<!ATTLIST popup name #IMPLIED >
+<!ATTLIST placeholder name #IMPLIED >
+<!ATTLIST menu name #IMPLIED
+ action #REQUIRED
+ pos (top|bot) #IMPLIED >
+<!ATTLIST menuitem name #IMPLIED
+ action #REQUIRED
+ pos (top|bot) #IMPLIED >
+<!ATTLIST toolitem name #IMPLIED
+ action #REQUIRED
+ pos (top|bot) #IMPLIED >
+</programlisting>
+There are some additional restrictions beyond those specified in the DTD, e.g.
+every toolitem must have a toolbar in its anchestry and every menuitem must have
+a menubar or popup in its anchestry. If a name is not specified, it defaults to
+the action. If an action is not specified either, the element name is used.
+</para>
+<para>
+The constructed widget hierarchy is very similar to the element
+tree of the XML, with the exception that placeholders are merged into their
+parents. The correspondence of XML elements to widgets should be almost obvious:
+<itemizedlist>
+<listitem><para>menubar: a #GtkMenuBar</para></listitem>
+<listitem><para>toolbar: a #GtkToolBar</para></listitem>
+<listitem><para>popup: a toplevel #GtkMenu</para></listitem>
+<listitem><para>menu: a #GtkMenu attached to a menuitem</para></listitem>
+<listitem><para>menuitem: a #GtkMenuItem subclass, the exact type depends on the action</para></listitem>
+<listitem><para>toolitem: a #GtkToolItem subclass, the exact type depends on the action</para></listitem>
+<listitem><para>separator: a #GtkSeparatorMenuItem or #GtkSeparatorToolItem</para></listitem>
+</itemizedlist>
+</para>
+<para>
+The pos attribute determines where a constructed widget is positioned wrt. to its
+siblings in the partially constructed tree. If it is "top", the widget is prepended,
+otherwise it is appended.
+</para>
+</refsect2>
+
<!-- ##### SECTION See_Also ##### -->
<para>
</para>
-
<!-- ##### STRUCT GtkUIManager ##### -->
<para>
</para>
-@parent:
<!-- ##### FUNCTION gtk_ui_manager_new ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_ui_manager_set_add_tearoffs ##### -->
+<para>
+
+</para>
+
+@self:
+@add_tearoffs:
+
+
+<!-- ##### FUNCTION gtk_ui_manager_get_add_tearoffs ##### -->
+<para>
+
+</para>
+
+@self:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_ui_manager_insert_action_group ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_ui_manager_activate ##### -->
+<para>
+
+</para>
+
+@self:
+@path:
+
+
+<!-- ##### SIGNAL GtkUIManager::add-widget ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+@widget:
+
+<!-- ##### SIGNAL GtkUIManager::changed ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+
+<!-- ##### ARG GtkUIManager:add-tearoffs ##### -->
+<para>
+
+</para>
+
TRUE,
G_PARAM_READWRITE));
+ /**
+ * GtkAction::activate:
+ * @action: the #GtkAction
+ *
+ * The "activate" signal is emitted when the action is activated.
+ *
+ * Since: 2.4
+ */
action_signals[ACTIVATE] =
g_signal_new ("activate",
G_OBJECT_CLASS_TYPE (klass),
/**
* gtk_ui_manager_new:
*
- * Creates a new menu merge object.
+ * Creates a new ui manager object.
*
- * Return value: a new menu merge object.
+ * Return value: a new ui manager object.
*
* Since: 2.4
**/
* @length: the length of @buffer (may be -1 if @buffer is nul-terminated)
* @error: return location for an error
*
- * Parses a string containing a UI description and merge it with the current
- * contents of @self. FIXME: describe the XML format.
+ * Parses a string containing a <link linkend="XML-UI">UI description</link> and
+ * merges it with the current contents of @self. An enclosing <ui> </ui>
+ * element is added if it is missing.
*
* Return value: The merge id for the merged UI. The merge id can be used
* to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred,
* @filename: the name of the file to parse
* @error: return location for an error
*
- * Parses a file containing a UI description and merge it with the current
- * contents of @self. See gtk_ui_manager_add_ui_from_file().
+ * Parses a file containing a <link linkend="XML-UI">UI description</link> and
+ * merges it with the current contents of @self.
*
* Return value: The merge id for the merged UI. The merge id can be used
* to unmerge the UI with gtk_ui_manager_remove_ui(). If an error occurred,